﻿<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Blazing.BusinessObjects.eCommerce" namespace="Blazing.BusinessObjects.Products" >
  <class name="Order" table="orders" dynamic-insert="true" dynamic-update="true">

    <id name="ID" column="orderid" type="Int32">
      <generator class="native" />
    </id>
    <timestamp column="rowstamp" name="RowStamp" />

    <many-to-one name="Orderer" class="Blazing.BusinessObjects.Contacts.Contact, Blazing.BusinessObjects" column="contactid" />

    <property name="IsPaid" type="Boolean" column="paid" />
    <property name="Total" type="Decimal" />
    <property name="Reference" length="255" />
    <property name="Receipt" length="255" />

    <list name="Items" table="orderitems">
      <key column="orderid"/>
      <index column="itemno" type="Int32" />
      <many-to-many class="Blazing.BusinessObjects.Products.Product" column="productid"/>
    </list>

  </class>
</hibernate-mapping>